<?php
    
    require_once( MODEL_DIR . "Model.class.php");
    
    class Rock5Model extends Model{
        
        protected $query;
        
        public function __construct()
        {
            parent::__construct();
        }

        # lsitar rock 5
        public function get_rock5(){
            
            $dataHoje = date("Y-m-d H:i:00");
            
            $set_where = "data_vigor <= '$dataHoje'";
            $set_order = "data_vigor DESC";

            #read(tabela,where,order,limite,cache);                               
            return parent::read("rock_five",$set_where,$set_order,1,1);
        }
        public function get_lista_rock5_images($id){
            
            $set_tabela = "rock_five_image";
            $set_where ="id_rock_five = $id" ;
            $set_order ="null";
            $set_limit = "1";
            $set_cache = "1";
            #echo $id;
            #read(tabela,where,order,limite,cache);                               
            return parent::read($set_tabela,$set_where,$set_order,$set_limit,$set_cache);
            
        }
         public function get_rock5_date($id){
            
            $set_tabela = "rock_five";
            $set_where ="null" ;
            $set_order ="id_rock_five DESC";
            $set_limit = "1";
            $set_cache = "1";
            
            #read(tabela,where,order,limite,cache);                               
            return parent::read($set_tabela,$set_where,$set_order,$set_limit,$set_cache);
        
         }
       
        
       
      
        
    }        
?>